/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.classic.Session;
import pojo.ChiTietHoaDon;
import util.HibernateUtil;

/**
 *
 * @author OSIRIS
 */
public class ChiTietHoaDonDAO extends AbstractDAO{

   public ChiTietHoaDonDAO() {
        super();
    }

    /**
     * Insert a new ChiTietHoaDon into the database.
     * @param info
     */
    public void create(ChiTietHoaDon info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }


    /**
     * Delete a detached ChiTietHoaDon from the database.
     * @param info
     */
    public void delete(ChiTietHoaDon info) throws DataAccessLayerException {
        super.delete(info);
    }

    /**
     * Find an ChiTietHoaDon by its primary key.
     * @param id
     * @return
     */
    public ChiTietHoaDon find(Integer id) throws DataAccessLayerException {
        return (ChiTietHoaDon) super.find(ChiTietHoaDon.class, id);
    }

    /**
     * Updates the state of a detached ChiTietHoaDon.
     *
     * @param info
     */
    public void update(ChiTietHoaDon info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }

    /**
     * Finds all ChiTietHoaDons in the database.
     * @return
     */
    public List findAll() throws DataAccessLayerException{
        return super.findAll(ChiTietHoaDon.class);
    }
}
